import java.io.File;


public class ExOnFile2 {

	public static String getExtension(File f) {
		String ext = null;
		String s = f.getName();
		int i = s.lastIndexOf('.');

		if (i > 0 && i < s.length() - 1) {
			ext = s.substring(i + 1).toLowerCase();
		}
		return ext;
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		//File[] fileArr = new File[0];
		File file1 = new File("C:\\Users\\ravipatr\\Desktop\\rama");
		File[] fileArr = (file1.exists())?file1.listFiles():null;
		if(fileArr == null){
			System.out.println("value is null");
		}
		System.out.println(fileArr.length);
		/*for(int i=0; i< fileArr.length; i++){
			int j = fileArr[i].getName().lastIndexOf('.');
			System.out.println(j);
			String str = ExOnFile2.getExtension(fileArr[i]);
			System.out.println(str);
			if (fileArr[i].getName().indexOf(".") > 0) {
				System.out.println("hiii");
			}
			*/
		}

}
